package com.ad_hccm.dao.GeneralInformation;

import com.ad_hccm.domain.GeneralInformation.Menstruation;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * TODO 月经Dao
 */
@Mapper
public interface MenstruationDao {
    @Insert("insert into menstruation value( #{id}, #{menstruation}, #{menarcheYear}, #{lingDay}, #{cycle}, #{lastMenstruation}, #{menopausalAge})")
    public boolean save(Menstruation menstruation);

    @Update("update menstruation set menstruation = #{menstruation}, menarcheYear = #{menarcheYear}, lingDay = #{lingDay}, cycle = #{cycle}, lastMenstruation = #{lastMenstruation}, menopausalAge = #{menopausalAge} where id = #{id}")
    public boolean update(Menstruation menstruation);

    @Select("select * from menstruation where id = #{id}")
    public Menstruation getById(String id);

    @Select("select * from menstruation")
    public List<Menstruation> getAll();
}

